.image-viewer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
  overflow: hidden;

  &.close {
    display: none;
  }

  .view-box {
    font-size: 0;
    position: relative;
    text-align: center;

    img {
      transform-origin: center center;
    }
  }

  .rate-text {
    position: absolute;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.3);
    top: 50%;
    left: 50%;
    pointer-events: none;
    font-size: 13px;
    padding: 5px 15px;
    border-radius: 3px;
    transform: translateX(-50%) translateY(-50%);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;

    &.show {
      opacity: 1;
    }
  }

  .control-close {
    width: 18px;
    height: 18px;
    line-height: 15px;
    font-weight: 600;
    font-size: 16px;
    padding: 0;
    text-align: center;
    position: absolute;
    right: 10px;
    top: 10px;
    border: none;
    outline: none;
    background-color: transparent;
    border-radius: 50%;
    cursor: pointer;
    color: #909399;

    &:hover {
      color: #ef4848;
    }
  }

  .toolbar {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%) translateY(50px);

    .bt {
      display: inline-block;
      width: 24px;
      height: 24px;
      border: none;
      outline: none;
      color: rgba(255, 255, 255, 0.7);
      background-color: rgba(0, 0, 0, 0.3);
      padding: 0;
      text-align: center;
      margin-right: 5px;
      vertical-align: middle;
      font-size: 13px;
      line-height: 24px;
      cursor: pointer;

      &:hover {
        background-color: rgba(0, 0, 0, 0.4);
        color: rgba(255, 255, 255, 1);
      }

      &:active {
        background-color: rgba(0, 0, 0, 0.5);
      }
    }

    .bt-group {
      display: inline-block;
      vertical-align: middle;
    }
  }

  &:hover .toolbar {
    animation: move-in 0.2s ease alternate forwards;
  }

  .arrow-icon {
    &.left {
      transform: rotate(90deg);
    }

    &.right {
      transform: rotate(-90deg);
    }
  }
}

@keyframes move-in {
  from {
    transform: translateX(-50%) translateY(50px);
    opacity: 0;
  }

  to {
    transform: translateX(-50%) translateY(0px);
    opacity: 1;
  }
}
